using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


/// <summary>
/// The EmployeeSalaryTableManager class is responsible for managing BO.EmployeeSalaryTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class EmployeeSalaryTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all EmployeeSalaryTable objects in the database.
/// </summary>
/// <returns>A list with all EmployeeSalaryTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeSalaryTableList GetList(){
return EmployeeSalaryTableDB.GetList();
}

[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeSalaryTableList GetList(int UserAccountKey)
{
    return EmployeeSalaryTableDB.GetListByUserAccountKey(UserAccountKey);
}
  

/// <summary>
/// Gets a single EmployeeSalaryTable from the database without its data.
/// </summary>
/// <param name="employeeSalaryKey">The EmployeeSalaryKey of the EmployeeSalaryTable in the database.</param>
/// <returns>A EmployeeSalaryTable object when the EmployeeSalaryKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeSalaryTable GetItem(int employeeSalaryKey){
return GetItem(employeeSalaryKey, false);
}

/// <summary>
/// Gets a single EmployeeSalaryTable from the database.
/// </summary>
/// <param name="employeeSalaryKey">The EmployeeSalaryKey of the EmployeeSalaryTable in the database.</param>
/// <param name="getEmployeeSalaryTableRecords">Determines whether to load all associated EmployeeSalaryTable records as well.</param>
/// <returns>
/// A EmployeeSalaryTable object when the EmployeeSalaryKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeSalaryTable GetItem(int employeeSalaryKey, bool getEmployeeSalaryTableRecords){
EmployeeSalaryTable myEmployeeSalaryTable = EmployeeSalaryTableDB.GetItem(employeeSalaryKey);
return myEmployeeSalaryTable;
}

/// <summary>
/// Saves a EmployeeSalaryTable in the database.
/// </summary>
/// <param name="myEmployeeSalaryTable">The EmployeeSalaryTable instance to save.</param>
/// <returns>The new EmployeeSalaryKey if the EmployeeSalaryTable is new in the database or the existing EmployeeSalaryKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(EmployeeSalaryTable myEmployeeSalaryTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int employeeSalaryTableEmployeeSalaryKey = EmployeeSalaryTableDB.Save(myEmployeeSalaryTable);

//  Assign the EmployeeSalaryTable its new (or existing EmployeeSalaryKey).
myEmployeeSalaryTable.EmployeeSalaryKey = employeeSalaryTableEmployeeSalaryKey;

myTransactionScope.Complete();

return employeeSalaryTableEmployeeSalaryKey;
}
}

/// <summary>
/// Deletes a EmployeeSalaryTable from the database.
/// </summary>
/// <param name="myEmployeeSalaryTable">The EmployeeSalaryTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(EmployeeSalaryTable myEmployeeSalaryTable){
return EmployeeSalaryTableDB.Delete(myEmployeeSalaryTable.EmployeeSalaryKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(int EmployeeSalaryKey)
{
    return EmployeeSalaryTableDB.Delete(EmployeeSalaryKey);
}
#endregion

}

